# -*- coding : utf_8 -*-
"""
=======================================
Time : 2025/4/8 16:12
Author : 田霄汉
Email : 522989570@qq.com
File : pandas_class04.py
Project : pandas_demo
Function : 数字，字符，日期填充
=======================================
"""

import pandas as pd
from config.setting import file_path
from utils.operation_date import OperationDate

excel04_path = file_path['excel_path'] + '/excel04.xlsx'
books = pd.read_excel(excel04_path,
                      skiprows=2,
                      usecols='B:E',
                      index_col=None,
                      dtype={'ID': str, 'BOOK_NUM': str, 'IS_SCORE': str})
# books['ID'],books['IS_SCORE'],books['ACCEPT_DATE']其实都是books的series
for i in books.index:
    books['ID'].at[i] = i + 1
    books['IS_SCORE'].at[i] = 'YES' if i % 2 == 0 else 'NO'
    books['ACCEPT_DATE'].at[i] = OperationDate().get_add_months('2014-01-31', i)
print(books)
